# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=mailimporter
pkgver=20.04.3
pkgrel=0
pkgdesc="KDE PIM library providing support for mail applications"
arch="all !armhf"
url="https://kontact.kde.org/"
license="GPL-2.0-or-later"
depends_dev="qt5-qtbase-dev karchive-dev kconfig-dev kcoreaddons-dev ki18n-dev akonadi-dev kmime-dev akonadi-mime-dev libkdepim-dev"
makedepends="$depends_dev extra-cmake-modules"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/mailimporter-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="6b43d614cd1ab1cd9bcf24c40e0d077abf65ef9c74d2237c5c7d02115ca6f85b43c1c2933124b69bda7b98e400af5ee4bf54031d3a42702b49e2634a0c7c5ef5  mailimporter-20.04.3.tar.xz"
